---
title: Random
description: A universal library for generating random bytes.
sourceCodeUrl: 'https://github.com/expo/expo/tree/sdk-49/packages/expo-random'
packageName: 'expo-random'
---

import APISection from '~/components/plugins/APISection';
import { APIInstallSection } from '~/components/plugins/InstallSection';
import PlatformsSection from '~/components/plugins/PlatformsSection';

> **warning** **Deprecated:** This module will no longer be available in SDK 49. Use [expo-crypto](crypto.mdx) instead.

`expo-random` provides a native interface for creating strong random bytes. With `Random` you can create values equivalent to Node.js core `crypto.randomBytes` API. `expo-random` also works with `expo-standard-web-crypto`, which implements the W3C Crypto API for generating random bytes.

<PlatformsSection android emulator ios simulator web />

## Installation

<APIInstallSection />

## API

```js
import * as Random from 'expo-random';
```

<APISection packageName="expo-random" apiName="Random" />
